<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>铭泊停车</title>
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <% include("/page/tags/jss_css_include.html"){} %>
    <script type="text/javascript" src="${basePath}/js/hui/hui-picker.js" charset="utf-8"></script>
    <script type="text/javascript" src="${staticPath}js/jquery.qrcode.min.js"></script>
    <style>
       center{
        height:100%;
        margin:auto 0;
        width:100%;
        display:flex;
        justify-content:center;
        align-item:center;
        }
    </style>
</head>
<body style="height:100%">
<header class="hui-header">
    <h1 id="showTitle">${parameter.lisc}</h1>
</header>

<div class="hui-wrap">
    <div class="hui-center-title" style="margin-top:15px;"><h1>选择出口</h1></div>
    <div style="padding:28px;">
        <button type="button" class="hui-button hui-button-large" id="btn1">请选择</button>
    </div>
    <center><div id="qrCodeDiv"></div></center>
</div>
<script>
    var parkId=localStorage.getItem("parkId");
    $(function () {
        $.get('${basePath}/front/x/parking_port/list?',{parkId:parkId ,portFunType:2},function (res) {
            showQR(res.data[0].id);
            hui('#btn1').html(res.data[0].portName);
            var picker1 = new huiPicker('#btn1', function () {
                var val = picker1.getVal(0);
                var txt = picker1.getText(0);
                hui('#btn1').html(txt);
                showQR(val);
            });
            var array=[];
            for (var i = 0; i < res.data.length; i++) {
                array.push({value:res.data[i].id,text:res.data[i].portName})
            }
            picker1.bindData(0, array);

        })
    })

    function showQR(portId){
        var qrUrl = '${basePath}/b/page-h5/pay_last_carout_u?parkId=' +parkId + '&portId=' + portId;
        $('#qrCodeDiv').empty();
        $('#qrCodeDiv').qrcode({
            width:200,
            height:200,
            text:qrUrl,
        });
    }
</script>
</body>
</html>